<?php
class test1{
    static $s='';
       public $m='';
       public $a=1;
       private function __construct()
       {
            $this->m=new test2();
       }
       static function set(){
            if(empty(test1::$s)){
                test1::$s= new test1();
            }
            return test1::$s;
       }
       public function get(){
           return $this->m->b->get();
       }
}
   $a=test1::set();



class test2{
   public $b='';
    public function __construct()
    {
         $this->b=new test3();
    }
}

class test3{
     private  $a=10;
    function get(){
         return $this->a;
    }
}